<template>
  <view :class="isShopCart ? 'shop-cart' : ''">
    <movable-area class="online-box" style="width:100vw;" :style="{ height: height }">
      <movable-view @change="changePosition" style="z-index:1000;" :x="x" :y="y" friction="10" inertia="false"
        direction="all" :animation="moveAnimation">
        <view class="kf_button"  @click="skipMemberGift" >
          <view class="tip" v-if="newNumber>0">
            {{newNumber}}
          </view>

        </view>

      </movable-view>
    </movable-area>
  </view>
</template>
<script>
  export default {
    data() {
      return {
        x: getApp().globalData.onLineServiceIithaX,
        y: getApp().globalData.onLineServiceIithaY,
        height: 0,
      };
    },

    props: {
      newNumber: String
    },

    mounted() {
      let systemInfo = uni.getSystemInfoSync()
      this.height = systemInfo.windowHeight - getApp().globalData.navBarHeight + 'px'
    },
    methods: {
      skipMemberGift() {
        this.$emit('skipMemberGift')
      }

    }
  };
</script>
<style lang="less" scoped>
  .tip {
    position: absolute;
    width: 32rpx;
    height: 32rpx;
    right: 2px;
    background: #CB171A;
    line-height: 32rpx;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .kf_button {
    border-radius: 50%;
    overflow: hidden;
    background-image: url(https://100000063-1252208446.file.myqcloud.com/images/飞书20220816-152609.png);
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .flex-box {
    display: flex;
    flex-direction: column;
  }


  .img-plus-style {
    height: 170rpx;
    width: 170rpx;
    position: fixed;
    bottom: 220rpx;
    right: 30rpx;
    opacity: 1;
  }

  .zindex100 {
    z-index: 100;
  }

  .yc {
    opacity: 1;
    background-color: white;
  }

  .shop-cart .fix-iphonex {
    // margin-top: -120rpx;
  }

  .online-box {
    position: fixed;
    left: 0;
    top: 168rpx;
    z-index: 1000;
    // z-index: -1;
    background-color: transparent;
  }

  movable-area {
    position: relative;
    pointer-events: none;
  }

  movable-view {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    // position: fixed;
    z-index: 9999;
    width: 108rpx !important;
    height: 108rpx !important;
    right: auto;
  }

  .guanzhu {
    width: 41rpx;
    height: 38rpx;
    margin-top: 20rpx;
  }
</style>
